package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BizCashConfigMapper;
import com.ruoyi.business.domain.BizCashConfig;
import com.ruoyi.business.service.IBizCashConfigService;
import com.ruoyi.common.core.text.Convert;

import javax.annotation.Resource;

/**
 * 兑现设置Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-10-03
 */
@Service
public class BizCashConfigServiceImpl implements IBizCashConfigService 
{
    @Resource
    private BizCashConfigMapper bizCashConfigMapper;

    /**
     * 查询兑现设置
     * 
     * @param id 兑现设置ID
     * @return 兑现设置
     */
    @Override
    public BizCashConfig selectBizCashConfigById(Long id)
    {
        return bizCashConfigMapper.selectBizCashConfigById(id);
    }

    /**
     * 查询兑现设置列表
     * 
     * @param bizCashConfig 兑现设置
     * @return 兑现设置
     */
    @Override
    public List<BizCashConfig> selectBizCashConfigList(BizCashConfig bizCashConfig)
    {
        return bizCashConfigMapper.selectBizCashConfigList(bizCashConfig);
    }

    /**
     * 新增兑现设置
     * 
     * @param bizCashConfig 兑现设置
     * @return 结果
     */
    @Override
    public int insertBizCashConfig(BizCashConfig bizCashConfig)
    {
        bizCashConfig.setCreateTime(DateUtils.getNowDate());
        return bizCashConfigMapper.insertBizCashConfig(bizCashConfig);
    }

    /**
     * 修改兑现设置
     * 
     * @param bizCashConfig 兑现设置
     * @return 结果
     */
    @Override
    public int updateBizCashConfig(BizCashConfig bizCashConfig)
    {
        bizCashConfig.setUpdateTime(DateUtils.getNowDate());
        return bizCashConfigMapper.updateBizCashConfig(bizCashConfig);
    }

    /**
     * 删除兑现设置对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBizCashConfigByIds(String ids)
    {
        return bizCashConfigMapper.deleteBizCashConfigByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除兑现设置信息
     * 
     * @param id 兑现设置ID
     * @return 结果
     */
    @Override
    public int deleteBizCashConfigById(Long id)
    {
        return bizCashConfigMapper.deleteBizCashConfigById(id);
    }
}
